home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / cdplay / cdplayer.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-05-08  |  2.2 KB  |  68 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "CD Player"
  5.    ClientHeight    =   435
  6.    ClientLeft      =   12780
  7.    ClientTop       =   10860
  8.    ClientWidth     =   2310
  9.    Height          =   840
  10.    Icon            =   CDPLAYER.FRX:0000
  11.    Left            =   12720
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    ScaleHeight     =   435
  15.    ScaleWidth      =   2310
  16.    Top             =   10515
  17.    Width           =   2430
  18.    Begin Timer TIMERControl 
  19.       Enabled         =   0   'False
  20.       Interval        =   500
  21.       Left            =   900
  22.       Top             =   570
  23.    End
  24.    Begin PictureBox MCIControl 
  25.       BackColor       =   &H000000FF&
  26.       Height          =   1000
  27.       Left            =   0
  28.       ScaleHeight     =   975
  29.       ScaleWidth      =   975
  30.       TabIndex        =   0
  31.       Top             =   0
  32.       Width           =   1000
  33.    End
  34. 'This little utility was developed to enjoy your favourite
  35. 'comact discs while working hard in your office.
  36. '1994 Andre Rippstein, Niederglatt, Switzerland
  37. Sub Form_Load ()
  38.     Dim lintLeft As Integer
  39.     Dim lintTop As Integer
  40.     lintLeft = (Screen.Width - Me.Width - 300) / Screen.TwipsPerPixelX
  41.     lintTop = (Screen.Height - Me.Height - 300) / Screen.TwipsPerPixelY
  42.     SetWindowPos Me.hWnd, HWND_TOPMOST, lintLeft, lintTop, 0, 0, SWP_NOSIZE
  43.     MCIControl.Notify = False
  44.     MCIControl.Wait = True
  45.     TIMERControl.Enabled = True
  46. End Sub
  47. Sub Form_Resize ()
  48.     If Me.WindowState = WS_MINIMIZED Then
  49.         SetWindowPos Me.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE + SWP_NOMOVE
  50.     Else
  51.         SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE + SWP_NOMOVE
  52.     End If
  53. End Sub
  54. Sub Form_Unload (Cancel As Integer)
  55.     TIMERControl.Enabled = False
  56.     MCIControl.Command = "Close"
  57. End Sub
  58. Sub MCIControl_EjectCompleted (ErrorCode As Long)
  59.     MCIControl.Command = "Close"
  60.     TIMERControl.Enabled = True
  61. End Sub
  62. Sub TIMERControl_Timer ()
  63.     MCIControl.Command = "Open"
  64.     If MCIControl.Error = 0 Then
  65.         TIMERControl.Enabled = False
  66.     End If
  67. End Sub
  68.